package com.baidu.controller;

import com.baidu.entity.*;
import com.baidu.service.CreditService;
import com.baidu.utils.Result;

import lombok.extern.log4j.Log4j;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.io.IOException;
import java.util.Map;


/**
 * @author 田甜
 * @version 1.0
 * @description: TODO
 * @date 2021/12/13 0013 8:45
 */
@RestController
@RequestMapping("/tby")
@CrossOrigin
@Slf4j
public class CreditController {
      @Autowired
    private CreditService creditService;
     //普通登录
     @PostMapping("/login")
     public Result login(@RequestBody TbyRegister tbyRegister) throws IOException {
         log.info("普通登录");
          return creditService.login(tbyRegister);
      }
    //登录表
      @PostMapping("/capled")
      public void zhuce(@RequestBody TbyRegister tbyRegister,Map map)
      {
          //注册时候生成对应的表里面数据为null
          log.info("注册");
           creditService.capled(tbyRegister,map);
      }

}
